package com.farm.service.impl;

import com.farm.dao.CropsDiseaseMapper;
import com.farm.opjo.CropsDisease;
import com.farm.service.CropsDiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CropsDiseaseServiceImpl implements CropsDiseaseService {
    @Autowired
    private CropsDiseaseMapper cropsDiseaseMapper;

    /**
     * 根据农作物ID 添加
     * @param cropsDisease
     * @return
     */
    @Override
    public void add(CropsDisease cropsDisease) {
        cropsDiseaseMapper.insert ( cropsDisease );
    }

    /**
     * 根据农作物ID删除
     * @param cid
     */
    @Override
    public void deleteByCid(int cid) {

    }

    /**
     * 根据农作物ID查询
     * @param cid
     * @return
     */
    @Override
    public CropsDisease findByCId(int cid) {
        return  null;
    }

    /**
     * 根据农作物ID更新t_crops_disease中间表数据
     * @param cropsDisease
     * @return
     */
    @Override
    public void update(CropsDisease cropsDisease) {
        cropsDiseaseMapper.updateByPrimaryKey ( cropsDisease );
    }
}
